package com.cloud.config;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: TongRui乀
 * @Date: 2019/10/15 16:50
 * @description：  全部配置生效
 */
//@Configuration
//@RibbonClient(name = "cloud-service-02-Ribbon", configuration = Service2RibbonConfig.class)
public class SpecialRibbonConfiguration {



}

@Configuration
class Service2RibbonConfig{


    /**
     *  修改负载均衡策略
     * @return
     */
    @Bean
    IRule randomRule(){
        return new RandomRule();
    }

}
